package com.domain.factory;

import com.domain.DO.User;
import com.domain.DTO.UserDto;
import com.domain.VO.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author 大忽悠
 * @create 2022/11/11 11:51
 */
public class UserFactory {
    public static final UserConvert USER_CONVERT= Mappers.getMapper(UserConvert.class);

    @Mapper
    public interface UserConvert{
        @Mapping(target = "id",ignore = true)
        User toUser(UserVO userVO);
        UserDto toUserDto(User user);
        List<UserDto> toListUserDto(List<User> userList);
    }
}
